/**
 * Copyright(c),2018-2018
 * FileName:  RoleBizImpl
 * Author:    旭哥
 * Date:      2018/10/21 15:15
 * Description:
 * History:
 * <author>  <time>  <version> <desc>
 ***/
package com.supply.supplymanage.biz;

import com.supply.supplymanage.dao.RoleMapper;
import com.supply.supplymanage.entity.Role_permission;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class RoleBizImpl implements  RoleBiz {

    @Resource
    private RoleMapper roleMapper;

    @Override
    public List<Map> queryRole() {

        return roleMapper.queryRole();

    }

    @Override
    public List<Map> addRolePre(Role_permission rp) {

        return roleMapper.addRolePre(rp);
    }

    @Override
    public List<Map> queryPer() {
        List<Map> maps = roleMapper.queryPer();
        return maps;
    }

    @Override
    public List<Map> querybyQuan(int roleid) {
        List<Map> querybyQuan = roleMapper.querybyQuan(roleid);
        return querybyQuan;
    }

    @Override
    public int addRolePer(Integer roleid, Integer perid) {
        Map maps = new HashMap();
        maps.put("roleid", roleid);
        maps.put("perid", perid);
        roleMapper.addRolePer(maps);
        return 0;
    }

    @Override
    public int delRolePer(Integer roleid, Integer perid) {
        Map map = new HashMap();
        map.put("roleid", roleid);
        map.put("perid", perid);
        roleMapper.addRolePer(map);
        return 0;
    }


}
